﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Reflection;
using WpfFeeCalculator.Infrastructure;


namespace WpfFeeCalculator.Helpers
{
    /// <summary>
    /// wrap lock and unlock in a using statement
    /// </summary>
    public class LockWorkbookView : IDisposable
    {
        private readonly SpreadsheetGear.Windows.Forms.WorkbookView view;
        public LockWorkbookView(SpreadsheetGear.Windows.Forms.WorkbookView view)
        {
            this.view = view;
            view.GetLock();
        }
        public void Dispose()
        {
            view.ReleaseLock();
        }
    }
}
